﻿using LBSoft.Business;
using LBSoft.Common.DotNetConfig;
using LBSoft.Common.DotNetExt;
using LBSoft.Common.DotNetJson;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace LBSoft.HplusAdmin.Business.MapCoordinates
{
    /// <summary>
    /// SetMapPos1 的摘要说明
    /// </summary>
    public class SetMapPos1 : IHttpHandler
    {
        HttpContext con = null;
        Common_Dal systemidao = new Common_Dal();
        mJsonResult json = new mJsonResult();

        public void ProcessRequest(HttpContext context)
        {
            con = context;
            switch (con.Request["PostType"])
            {
                case "get": GetData(); break;
            }
        }

        #region 获取
        private void GetData()
        {
            switch (con.Request["ActionType"])
            {
                case "InitialLocation": InitialLocation(); break;
            }
        }

        private void InitialLocation()
        {
            json.success = true;
            string MapPos = con.Request["MapPos"].ToString2();
            if (!string.IsNullOrEmpty(MapPos) && MapPos != "undefined" && MapPos != "null")
            {
                json.text = MapPos;
            }
            else
            {
                json.text = ConfigHelper.GetAppSettings("CityMapPos").ToString2();
            }
            con.Response.Write(JsonConvert.SerializeObject(json));
        }
        #endregion

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}